#ifndef _IMAGE_BUTTON_H_
#define _IMAGE_BUTTON_H_

#include <button.h>

namespace lgb_gtk
{
  gboolean
    OnImageButtonPress(GooCanvasItem *item,
		       GooCanvasItem *target_item,
		       GdkEventButton *event,
		       gpointer user_data);
  gboolean
    OnImageButtonMouseOver(GooCanvasItem *item,
			   GooCanvasItem *target_item,
			   GdkEventButton *event,
			   gpointer user_data);
  gboolean
    OnImageButtonMouseOut(GooCanvasItem *item,
			  GooCanvasItem *target_item,
			  GdkEventButton *event,
			  gpointer user_data);
  
  class ImageButton : public Button
  {
    GooCanvasItem *bgCanvas;
    GooCanvasItem *igCanvas;
    GooCanvasItem *cgCanvas;
    string bgPath;
    string igPath;
    string cgPath;

    int LoadAllCanvas();
    ButtonStat curStat;

  public:
    ImageButton();
    ~ImageButton();

    friend gboolean OnImageButtonPress(GooCanvasItem *item,
				       GooCanvasItem *target_item,
				       GdkEventButton *event,
				       gpointer user_data);
    friend gboolean OnImageButtonMouseOver(GooCanvasItem *item,
					   GooCanvasItem *target_item,
					   GdkEventButton *event,
					   gpointer user_data);
    friend gboolean OnImageButtonMouseOut(GooCanvasItem *item,
					  GooCanvasItem *target_item,
					  GdkEventButton *event,
					  gpointer user_data);
    
    virtual int SetLabel(string newLabel) ;
    virtual int SetImages(string bg, string ig , string cg) ;
    virtual int Init();

    int SetCurStat(ButtonStat stat);
    string Type(){ return "ImageButton"; }
  };

}

#endif
